package main;

import processing.core.PApplet;

public class ReDraw extends PApplet {

    public float y;

    @Override
    public void settings() {
        size(640, 360);

    }

    @Override
    public void setup() {
        stroke(255);
        noLoop();
        y = height * 0.5f;
    }

    @Override
    public void draw() {

        background(0);
        y = y - 4;
        if(y < 0){
            y = height;
        }
        line(0, y, width, y);

    }

    @Override
    public void mousePressed() {
        redraw();
    }

}
